package db

import (
	"meituan/utils/config"

	"github.com/jinzhu/gorm"
)

func NewDB() (db *gorm.DB, err error) {
	//db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local")
	bc, _ := config.LoadConfig()
	db, err = gorm.Open("mysql", bc.Gin.Db.Mysql.Url)
	db.LogMode(bc.Gin.Db.Mysql.Debug)
	return
}
